/**
 * vue-cli render
 */

const fs = require('fs')
const yamlFront = require('yaml-front-matter')

//  yaml.yaml
//  package.json
//  index.vue
//  create-overall.png
//  .gitignore

// fs.readFile('index.vue', 'utf8', function(error, fileContents) {
//   console.log(fileContents)
//   console.log(yamlFront.loadFront(fileContents))
// })

function setParsed() {
  const template = fs.readFileSync('index.vue', 'utf-8')

  const parsed = yamlFront.loadFront(template)
  const content = parsed.__content
  let finalTemplate = content.trim() + `\n`

  // console.log(parsed)
  return { parsed, finalTemplate, content }
}
// setParsed()

module.exports = setParsed
